package com.hc.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hc.common.bean.PageBean;
import com.hc.domain.Category;
import com.hc.domain.Proj;
import com.hc.domain.User;
import com.hc.query.TechnologyVO;
import com.hc.query.UserVO;
import com.hc.res.CategoryDTO;
import com.hc.res.ProjListItemDTO;
import com.hc.trans.CategoryTrans;
import com.hc.trans.ProjTrans;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.hc.domain.Technology;
import com.hc.mapper.TechnologyMapper;
import com.hc.service.TechnologyService;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: hecai
 * @date: 2021/11/9 11:17
 * @description:
 */
@Service
public class TechnologyServiceImpl implements TechnologyService {

    @Resource
    private TechnologyMapper technologyMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return technologyMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Technology record) {
        return technologyMapper.insert(record);
    }

    @Override
    public int insertSelective(Technology record) {
        return technologyMapper.insertSelective(record);
    }

    @Override
    public Technology selectByPrimaryKey(Long id) {
        return technologyMapper.selectByPrimaryKey(id);
    }

    @Override
    public PageBean<Technology> selectPageByCondition(Integer pageNum, Integer pageSize, TechnologyVO technologyVO) {
        Page<Technology> page = PageHelper.startPage(pageNum, pageSize);
        technologyMapper.selectTechnologysByCondition(technologyVO);
        PageBean<Technology> pageBean = PageBean.init(page);
        return pageBean;
    }

    @Override
    public int updateByPrimaryKeySelective(Technology record) {
        return technologyMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Technology record) {
        return technologyMapper.updateByPrimaryKey(record);
    }

    @Override
    public Technology selectByName(String name) {
        return technologyMapper.selectByName(name);
    }

    @Override
    public List<Technology> getTechnologyByCondition() {
        return technologyMapper.getTechnologyByCondition();
    }

    @Override
    public int avctiveByPrimaryKey(Long id) {
        return technologyMapper.avctiveByPrimaryKey(id);
    }

    @Override
    public int disabledByPrimaryKey(Long id) {
        return technologyMapper.disabledByPrimaryKey(id);
    }

    @Override
    public List<Long> selectIdsByName(String[] names) {
        return technologyMapper.selectIdsByName(names);
    }


    @Override
    public String selectTidByPrimaryKey(Long id) {
        return technologyMapper.selectTidByPrimaryKey(id);
    }
}